﻿using IceCS.DesignPattern.Core.FactoryPattern.ACalc.Operations;

namespace IceCS.DesignPattern.Core.FactoryPattern.ACalc
{
    public class OperationFactory
    {
        public static Operation CreateOperation(string operateKey)
        {
            Operation op = null;
            switch (operateKey)
            {
                case "+":
                    op = new OperationPlus();
                    break;
                case "-":
                    op = new OperationSubtract();
                    break;
                case "*":
                    op = new OperationMultiply();
                    break;
                case "/":
                    op = new OperationDivide();
                    break;
                case "^":
                    op = new OperationPower();
                    break;
            }
            return op;
        }
    }
}
